﻿namespace NJQuery {
	using System;
	using System.Text;
	using System.Web;

	/// <summary>
	/// Defines the contract needed by the jQuery <see cref="Manager"/> control to render unified events, scripts and styles.
	/// </summary>
	/// <seealso cref="Manager"/>
	public interface IManagedControl {


		#region Methods

		/// <summary>
		/// Renders the jQuery "Ready Event" script required to generate the client-side jQuery widget.
		/// This method is used primarily by control developers.
		/// </summary>
		/// <param name="script">A <see cref="ScriptBuilder"/> that creates the output stream to render jQuery JavaScript on the client.</param>
		void RenderReadyScript(ScriptBuilder script);

		/// <summary>
		/// Renders a script to be executed on page startup.
		/// This method is used primarily by control developers.
		/// </summary>
		/// <param name="script">A <see cref="ScriptBuilder"/> that creates the output stream to render jQuery JavaScript on the client.</param>
		void RenderStartupScript(ScriptBuilder script);

		/// <summary>
		/// Renders a script to be executed on form/postback submit.
		/// This method is used primarily by control developers.
		/// </summary>
		/// <param name="script">A <see cref="ScriptBuilder"/> that creates the output stream to render jQuery JavaScript on the client.</param>
		void RenderSubmitScript(ScriptBuilder script);

		#endregion


	}

}